<?php
/**
 * The Template for displaying category posts.
 *
 * @file      category.php
 * @author    Chinh Tran.
 * @link 	  http://dailynews.com
 */
 
?>
<?php get_header(); ?>
<div class="body">
    <div class="home-main cate-main">
    <div class="left">
        <style>
            .clearfix:after {
                display: block;
                clear: both;
                width: 0;
                width: 0;
                content: "";
            }
        </style>
    
        <div class="title">
            <h3><?php single_cat_title();?></h3>
            
            <div class="datetime"><?php echo sw_get_current_weekday(); ?></div>
        </div>
        <?php if (have_posts()) { ?>
        <div class="list-items">
            <ul>
                
                		
    			<?php while (have_posts()) : the_post(); ?>
    		          <li>
                        <a href="<?php esc_url(the_permalink())?>" class="cate_item_img" style=" display: block; margin-right: 10px; float: left; background-image: url(<?php echo get_bg_image(get_the_ID());?>)">
                            <?php if ( has_post_thumbnail() ) { the_post_thumbnail('cate_thumb'); } else{ echo get_default_image(180, 100); }?>
                        </a>
                        <a href="<?php esc_url(the_permalink())?>"><?php the_title()?></a>
                        <div class="extra" style="height: 12px; text-align: left;"><span class="datetime"><?php the_date('H:i | d/m/Y'); ?></span></div>
                            <?php the_excerpt(); ?>
                            <a class="detail" href="<?php esc_url(the_permalink())?>">Xem tiếp</a>
                        
        
                        <div class="clear"></div>
                    </li>
                
    			<?php 
                endwhile; 
                    
                ?> 
		      
            </ul>
        </div>
        <?php
            wp_paginate();
        } else { ?>
    				<h1 class="single-title" >Nothing found</h1>
  		<?php } ?> <!-- /have_posts -->	
        <!--div class="paginator">
            <li class="page_info">Trang 0 / 40</li>
            <ul id="yw0" class="yiiPager">
                <li class="first hidden"><a href="#">&lt;&lt; Đầu tiên</a></li>
                <li class="previous hidden"><a href="#"><img src="<?php echo get_template_directory_uri(); ?>/images/arrow-left.png"/></a></li>
                <li class="page selected"><a href="#">1</a></li>
                <li class="page"><a href="#">2</a></li>
                <li class="page"><a href="#">3</a></li>
                <li class="next"><a href="#"><img src="<?php echo get_template_directory_uri(); ?>/images/arrow-right.png"/></a></li>
                <li class="last"><a href="#">Cuối &gt;&gt;</a></li>
                </ul>    
        </div-->

<!--script>
        var adsUrl = 'http://ads.autodaily.vn/ads/export?page=cate';
    var now = new Date();
    var rnd = Math.random();
    var srnd = now.getTime() * rnd;
    adsUrl += '&rnd=' + srnd;
    (function() {
        var atdlAds = document.createElement('script');
        atdlAds.type = 'text/javascript';
        atdlAds.async = true;
        atdlAds.src = adsUrl;
        var script = document.getElementsByTagName('script')[0];
        script.parentNode.insertBefore(atdlAds, script);
    })();
</script-->
    </div>
    <div class="right">
        <div id="banner2double" class="banner-300px">
            <div id="banner2a" style="margin-bottom: 8px;"></div>
            <div id="banner2b" style="margin-bottom: 8px;"></div>
        </div>

        <div class="home-video">
            <div class="title"><a href="/video/">VIDEOS</a></div>
            <div class="content">
                <p class="video-title"> <a href="#">Ford Ranger 2015 "lộ" những hình ảnh đầu tiên</a> </p>
                <iframe style="position: relative" width="300" height="250" src="http://www.youtube-nocookie.com/embed/uuwM7t21gsU?&rel=0" frameborder="0" allowfullscreen></iframe>
    
                <p class="video-item"> <a href="#">Giới trẻ Trung Quốc "chơi" siêu xe tại Mỹ</a> </p>
                <p class="video-item"> <a href="#">Xem chiếc xe lộn ngược đi kiểu gì?</a> </p>
                <p class="video-item"> <a href="#">Mercedes-Benz giới thiệu siêu phẩm concept tuyệt đẹp</a> </p>
            </div>        
        </div>
             
                
        <div id="banner6double" class="banner-300px" style="margin-top: 8px;">
            <div id="banner6a" style="margin-bottom: 8px;"></div>
            <div id="banner6b" style="margin-bottom: 8px;"></div>
        </div>
        
    </div>
</div>
<div class="clear"></div>
</div>
<?php get_footer(); ?>